<template>
  <div class="fullscreen-image-container" @click="closeFullscreen">
    <img :src="imgSrc" alt="Fullscreen Image" class="fullscreen-image">
  </div>
</template>

<script>
export default {
  name: 'FullscreenImage',
  props: {
    imgSrc: {
      type: String,
      required: true
    }
  },
  methods: {
    closeFullscreen() {
      this.$emit('close');
    }
  }
}
</script>

<style scoped>
.fullscreen-image-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景作为遮罩层 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer; /* 添加指针样式，提示可点击 */
}

.fullscreen-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
}
</style>
